libostree: Ensure progress keys are all always set
authorPhilip Withnall <withnall@endlessm.com>
Fri, 5 May 2017 14:17:13 +0000 (15:17 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 5 May 2017 14:58:03 +0000 (14:58 +0000)
If one of the progress keys is set in a pull operation, a ::changed
signal is emitted on the progress object, and the callback for that
could query any of the progress keys — so they all need to be set,
otherwise we get an assertion failure in ostree_async_progress_get() due
to a named key not existing.

Spotted by Dan Nicholson in PR #819.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Closes: #835
Approved by: cgwalters

src/libostree/ostree-repo-pull.c

index 35598eca257c2092ef2b3c30aabc97369167e964..12f93ab05a9d93af3513e5889acf517a88793d31 100644 (file)
@@ -3477,6 +3477,9 @@ ostree_repo_pull_with_options (OstreeRepo             *self,
       guint shift; 
       GString *buf = g_string_new ("");
 
+      /* Ensure the rest of the progress keys are set appropriately. */
+      update_progress (pull_data);
+
       if (bytes_transferred < 1024)
         shift = 1;
       else